package com.liwq.base.bolckqueue;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * @author : liwq
 * @version : 1.0
 * @date : 2023/1/30
 **/
public class BlockQueueDemo {

    public static void main(String[] args) {

        BlockingQueue<String> queue = new ArrayBlockingQueue<>(3);

        System.out.println(queue.add("a"));
        System.out.println(queue.add("b"));
        System.out.println(queue.add("c"));
        System.out.println(queue.element());
        //System.out.println(queue.add("D"));

//        System.out.println(queue.remove());
//        System.out.println(queue.element());


    }
}
